home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
003.dms
/
003.adf
/
TEXT
/
chapter11.txt
< prev
next >
Wrap
Text File
|
1992-09-02
|
4KB
|
169 lines
The Absolute Beginners Guide To Amos
-------------------------------------
Chapter eleven
--------------
I think it`s high time we took a closer look at pictures, EXAMPLE11.Amos
listed below, is a mini slide show with music program.
REM Mini slideshow with fades and music
HIDE: TRACK LOOP ON: TRACK PLAY 5
BEGIN:
UNPACK 12 TO 0
WAIT 400
FADE 5
WAIT 75
UNPACK 11 to 0
WAIT 400
FADE 1
WAIT 15
UNPACK 10 TO 0
WAIT 400
FADE 10
WAIT 150
GOTO BEGIN
Hold on! Where are the LOADIFF and TRACK LOAD commands for the pictures and
music? The answer is, we don`t need them because the pictures and music
are already stored inside the program in memory banks. First I will explain
about the music. Right you have just loaded up Amos and you are sitting in
front of the blank editor, press escape to go into direct mode, now type in:
TRACK LOAD "DF0:MUSIC/MOD.FUN",5
This is the same line that we would use in the program normally to LOAD the
the music. Obviously you can change the name of the file you want to load
from "DF0:MUSIC/MOD.FUN",5 to that of your choice.
The music is now stored in bank five, now still in Direct mode type:
TRACK PLAY 5
and you will now hear the music play.
When you save the program the contents of any permanent memory bank in use is
saved along with the basic listing and when you reload it the music will
still be there in bank five. So a simple, TRACK PLAY 5, will start it again.
There are certain types of banks that are not saved along with the program
but we are not concerned with that at the moment as we are concentrating on
music and pictures.
The pictures use the same technique. I loaded the music into bank five as
described then I loaded a picture from disk into the default screen which is
zero like this,
LOADIFF "DF0:PICS/SONIC.IFF",0
The same as we would inside a program, but staying in direct mode.
I then typed the magical command,
SPACK 0 to 10
Which tells Amos to sPACK the picture in screen 0 and store it in bank ten.
I repeated this for two more pictures SPACKing them into banks 11 and 12
then I typed,
LISTBANK
to check the banks were there and then returned to the blank editor to save
the blank program listing off which automatically saved the banks along with
it. To display a SPACKed picture from a bank we use the command,
UNPACK BANK TO SCREEN
So if for example we had a picture stored in bank 7 and we wanted to UNPACK
it to the default screen we would use:
UNPACK 7 TO 0
And that is all there is to it. The benefits of SPACKING pictures are that
because they are packed they use up less memory and disk space, keep the
program listing free of LOAD commands and no slow disk access is required.
Note: When you UNPACK a picture it does not erase the bank so you can keep
UNPACKING as many copies of the picture as you need. If you do need or
want to delete the picture from the bank just use ERASE bank number.
For example ERASE 10.
Note2: Amos automatically uses the palette of any picture you unpack in case
you were wondering!
So to the program breakdown:
HIDE: TRACK LOOP ON: TRACK PLAY 5
----------------------------------
Hide the mouse pointer to keep things tidy, set the music to LOOP,
PLAY the music that is stored in bank five.
BEGIN:
------
A label (or marker if you like) for GOTO to - GO TO .
UNPACK 12 TO 0
--------------
Unpack the previously SPACKED picture from bank 12 to screen 0.
WAIT 400
--------
WAIT eight seconds to give the user time to view the picture.
FADE 5
------
Literally FADEs the screen to black, try different values if you like.
WAIT 75
-------
This WAIT is necessary to give the FADE enough time to finish, you can
work out the exact timing by using FADE speed*15 (5*15=75)
UNPACK 11 to 0
--------------
Unpack the picture in bank 11 to screen 0.
WAIT 400
--------
Wait 8 seconds.
FADE 1
------
Try a different fade.
WAIT 15
-------
WAIT 1*15
UNPACK 10 TO 0
--------------
Unpack bank 10 to screen 0.
WAIT 400
--------
Guess!
FADE 10
-------
FADE it out.
WAIT 150
--------
Give the FADE time to do it`s job.
GOTO BEGIN
----------
Jump to the line marked LABEL and start unpacking the pics again.
As a bit of homework why not change the pictures, music and FADEs?
End of chapter eleven.